using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Calendar
{
    public partial class frmLogin : Form
    {
        frmCalendarView frmCal;
        public frmLogin()
        {
            InitializeComponent();
        }

        private void btnSignIn_Click(object sender, EventArgs e)
        {
            frmCal = new frmCalendarView();
            //frmCal.ContextMenuStrip.Items["signInToolStripMenuItem"].Enabled = false;
            //frmCal.ContextMenuStrip.Items["signOutToolStripMenuItem"].Enabled = true;
            this.ContextMenuStrip.Items[1].Enabled = false;
            this.ContextMenuStrip.Items[2].Enabled = true;
            frmCal.Show();
            this.Hide();
            this.Visible = false;
        }

        private void frmLogin_Load(object sender, EventArgs e)
        {
            notifyIcon1.Icon = new System.Drawing.Icon(Application.StartupPath + "\\Icon_02.ico");
            notifyIcon1.Visible = true;
            notifyIcon1.Text = "SMART Manager Calendar";

            this.Visible = false;
            this.ShowInTaskbar = false;
            this.WindowState = FormWindowState.Minimized;
        }

        private void signInToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Visible = true ;
            this.ShowInTaskbar =true ;
            this.WindowState = FormWindowState.Normal ;
        }

        private void signOutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmCal.Hide();
            this.Show();
        }
    }
}